/* $RCSFile: IEditModule.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/ADNCRM.Core/UI/WebControls/IEditModule.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:30  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.Reflection;

namespace AddonNice.UI.WebControls
{
	/// <summary>
	/// Default interface for edit modules
	/// </summary>
	public interface IEditModule
	{
		#region Events
		/// <summary>
		/// Purpose: Property to Allow Control to add records.
		/// </summary>
		bool AllowAdd 
		{
			set;
			get;
		}
		
		/// <summary>
		/// Purpose: Property to Allow Control to update records.
		/// </summary>
		bool AllowUpdate 
		{
			set;
			get;
		}
		
		/// <summary>
		/// Purpose: Property to Allow Control to delete records.
		/// </summary>
		bool AllowDelete 
		{
			set;
			get;
		}
		#endregion

		#region Events
		
        /// <summary>
		/// Purpose: Notify when Editing has been canceled.
		/// </summary>
		/// <delegate>EventHandler</delegate>
		event EventHandler CancelEdit;
		
#endregion

		#region Methods
		/// <summary>
		/// The module select the requested item and starts editing the module.
		/// </summary>
		/// <param name="itemID">The param is string to be more general. Usually it contains a number.</param>
		void StartEdit(string itemID);
		
		/// <summary>
		/// Purpose: Method the List control after data has been updated by the Edit control.
		/// </summary>
		void Reset();

		/// <summary>
		/// Purpose: Displays any error messages.
		/// </summary>
		/// <param name="e" type="Exception">The Exception to display.</param>
		void HandleError(Exception e);
		#endregion
	}
}